/************************************************
 * Copyright (c) 2007 ~ 2009, 
 * All rights reserved.
 * Version   : 1.0
 * Author    : lengsh@gmail.com 
 * Date      : 2009.1.2
 ************************************************/

#ifndef  __COBWEBBDB__H__
#define  __COBWEBBDB__H__

#include <sys/types.h>
#include <iostream>
#include <iomanip>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <db_cxx.h>
#include <string>

using namespace std;

class CobWebBDB
{
	protected:
                string m_dbHome;
                string m_dbName;

		DbEnv *dbenv;
		Db *db;
	public:
	public:
		CobWebBDB(const char *name, const char *home);
		~CobWebBDB();
		bool Initialize();
		bool Save(char *key, uint32_t klen, char *val, uint32_t vlen );
		bool Replace(char *key, uint32_t klen, char *val, uint32_t vlen );
		bool Fetch(char *key, uint32_t klen, string &val);
	private:

};

#endif  // __EVENTS_CONNECTION__H__
